Counterstrike AI!

by:	David Sellick (A>K<A Switeck)

"If they ain't coming out of the woodwork, something went wrong."

"And YES, It cheats."


NOTE: This ai uses hacked units which *MUST* be installed on all
computers in a multiplayer game in order for the ai to work.

To install:
----------
NOTE: Since the Zip file has a tree structure, it should work JUST
FINE to unzip it directly to the TOTALA directory.

IF THAT DOESN'T WORK:

1.Move the UFO files into the TOTALA directory.
(This directory is typically C:\CAVEDOG\TOTALA)
These files are:
Ai_Air.ufo		Ai-only aircraft
Ai_Cheat.ufo	Ai-only resource units and factories
Ai_Jam.ufo		Ai-only mobile jammers
Ai_TACConly.ufo	use *ONLY* if you have TA:CC - more cheats
Swi_nuke.ufo	Ai-only nuke silos and fake nuke silos

2.Create an AI directory under the TOTALA directory.
(This directory is typically C:\CAVEDOG\TOTALA\AI)
3.Move the TXT files into the AI directory.
4.Create a GAMEDATA directory under the TOTALA directory.
5.Move the SIDEDATA.TDF and LOS.TDF file to the GAMEDATA directory.

It's installed!

SPECIAL FILES INCLUDED:
----------------------

SIDEDATA.TDF is actually a BUGFIX to TA, not something special that
CounterStrike needs to work - except on water maps - because without
it, the Arm ai's seaplane platform will quit producing units. The
Core ai will never build one in the FIRST place without it!

LOS.TDF is also a BUGFIX for TA, it adds the missing sight radii
out to the range of a Core Leviathan - so units are no longer so
blind. It's very helpful and should work ok even in multiplayer.

The 3 wav files go in a SOUNDS directory under the TOTALA directory.
They are anti-lag EMG files for use in IP games:
(This is EXTREMELY helpful if fighting a CoounterStrike ai in multi.)

armsml2.wav  = no sound of flash/peewee/warrior emg firing
lasrhit1.wav = no sound of EMG bullets hitting 
armsml3.wav  = no sound of brawlers firing

To TOTALLY remove this worthless, cheating, unfair ai:
-----------------------------------------------------

1.Delete the ai directory with all the text files in it.
2.Delete the Ai_whatever.UFO files (see above for names)
3.Delete the GAMEDATA directory.
(Deleting GAMEDATA directory removes the TA bugfixes.)

Don't delete all the UFO files if you want the Cavedog's ai to use the
special ai units - such as nukes and aircraft.
(but probably not AI_Cheat.ufo!)

Other ai profiles - particularly my "Mostly Harmless" ai -
can and will use these special ai units.

WHAT THIS AI DOES:
-----------------

This ai uses a simplistic renewable attack force. This is nothing new
for ai's in general, BUT many ai's do NOT have proper limits and/or
weights on attack units. If this ai's attack force is made up of say
14 flashes, 20 samsons, and 20 merls - and you kill the flashes
(which generally are in the front of the attack), the Flashes will
get replaced - but only by about as many flashes as were lost. Also
if you run the ai's attack force off, some of the merls ussually
survive and return later with "friends". Whatever works generally
becomes the predominate feature in the ai's attack force (since that
is what ussually survives the longest). As the ai builds its base,
its attack force grows more complex - starting out with only 1 or 2
level-1 unit types (such as Flashes and Samsons) and slowly
diversifying into many different unit types. This way, the ai can get
SOME use out of a couple types of specialty units - such as Shooters
and Phalanx(i? es?) which would get slaughtered if on their own. The
ground attack force has a maximum size of around 160 units, which if
reached would comprise about a 50/50 mix of level 1 and level 2
units.

The Ai's special nuke silos (in AI_nukes.ufo) are designed so only
the ai can use them. You *CAN* capture them and use them yourself,
but you CANNOT normally build them. They do not have to build nuke
missiles and instead rely on LONG reload times (of 3 minutes!) to
simulate the time it takes to build a nuke missile. Each nuke missile
fired from the silos costs 500 metal and 18,000 energy, so it should
take the ai a little while to get up enough energy to fire the first
nuke missile. Also included in Swi_nuke.ufo are 2 more ai-only units:
the Arm ai Stunner EMP Silo and the Core ai Neutron Silo. The Arm ai
Stunner EMP Silo costs less to fire than the ai nuke silos, but is
less useful and as a result is built less often by the ai.

The Ai cheats using unfair hacked units in the AI_Cheats.ufo. These
include starting resource providers and hacked cloaking fusion
reactors. It is IMPORTANT to note that the ai is limited to 1 (or 2
on hard) special starting resource buildings. The starting resource
buildings provide a massive +25 metal and +500 energy each (or half
that on easy) to sustain the ai's production until it can build level
3 resource units - but since it only builds 1 or 2 of them, killing
them causes the ai an almost instant resource crunch. (Note: Core's
hacked resource building makes +30 metal and +600 energy to cover
for its disadvantage against an Arm ai that likes to rush.) The hacked
cloaking fusion reactors are cloaked but not stealth (they show up on
radar, in other words) and provide +10 metal (only +5 metal for Arm's)
and +2000 energy for the same cost as the normal cloaking fusion
reactors. These super-powerful fusion reactors are to sustain massive
late-game energy consumption typical of a very large base.
(IE- Vulcans, berthas, nukes, Moho metal makers, etc...) It's a good
thing the hacked cloaking fusion reactors aren't any tougher than the
originals! The player cannot build but can capture these unfair
hacked resource units.

The ai also has access to a hacked Arm vehicle plant that builds at
2x normal rate and provides some resources (+5 metal and +100
energy), and a hacked Core Krogoth Gantry that builds at 3x normal
rate (since the ai DOESN'T ever assist its factories) and provides
some resources to partially cover the extra drain caused by building
a Krogoth at an increased rate. The buildrate increase on Krogoths
allows the ai to build a Krogoth from start to finish in about 10
minutes - if it doesn't run out of resources! This increased rate is
not quite as fast as guarding a normal Core Krogoth Gantry with the
Core (or ARM!) Commander and ONE Advanced Construction K-Bot. The
buildrate increase on the hacked Arm vehicle plant is only 1/2 as
fast as an ordinary Arm vehicle plant being guarded by the commander.


Although this cheating ai has a mucho-unfair amount of resources, the
endgame stats may show something odd -- the ai often ends up with
little wasted metal. Unlike most other hacked ai's, it's possible to
out-produce the ai resource-wise by the 40 minute mark using a
fusion/moho metal maker combo.


Difficulty:
----------
There is MANY ways to control the overall difficulty of this ai.
The Easy/Medium/Hard settings is the obvious way.

Easy - NO nukes, Berthas, EMP silos, Neutron silos, and few factories
and construction units. ALSO, the resources provided by any sources
are HALVED. Limited to only 1 hacked starting resource building, but
may occassionaly build 2 (this is a game bug).

Medium - limited use of nukes, Berthas, EMP silos, and Neutron silos.
Factories and construction units are hardly affected. Limited to only
1 hacked starting resource building, but may build 2. ALSO, the
resources provided by any sources is only 70% of normal.

Hard - is HARSH, there ARE limits on nukes, Berthas, EMP silos,
Neutron silos, Factories, and construction units -- but the ai is
still allowed to produce a considerable number of each. Although
limited to 2 hacked starting resource building, the ai will
occassionally build 3!

Another important consideration is the ai's starting resources.
If the ai starts with 10k resources, it will attack earlier and
sustain its attack and building production for longer. If only 1k,
the ai will have an early attack but it generally will grow slower
and its attcks will be smaller and with fewer reinforcements. If you
want a slightly longer wait before the ai becomes a threat, start it
off with 200/200 resources.

NOTE: On Metal maps, due to a bug in the game, the ai may not work if
given below 1k starting resources.

Also, standard metal and nonmetal land maps are where the ai
functions best. On water maps, the ai produces slowly even with the
extra production gains. And on Acid, Hover, and Urban maps the ai
will build even slower. Worst of all are all-water or nearly all
water maps, here the ai may not function at all.

Helpful for the ai is the 500 unit maximum patch (totala.ini file).
This allows the ai to build an extremely large base and attack force,
if given a chance.

Probably the hardest difficulty imaginable with this ai would be:
Game set to HARD difficulty.
9 ai's allied together vs the player. (Some Arm, others Core)
Large, nonmetal land map with few good metal spots.(Painted Desert?)
All the ai's start with 10k resources.
The player starts with only 1k resources. (or less!)

I'm not saying that such a setting would be unbeatable, but
I imagine it would be EXTREMELY hard to do so!


Units used by the ai and located in the UFO files:
-------------------------------------------------

SWI_NUKE.UFO

Unit abbv.	Unit #	WEAPON NAME		WEAPON ID #
NUKEA 	420		AINUKE		230
NUKEC 	421		AICNUKE		231
AAIEMP	422		AAIEMP		232
CAITRON	423		AICNUKE		231
ARMFSILO	424		ARMSHIP_ROCKET	* Buildable by the player (menu 4:4)
CORFSILO	425		CORSHIP_ROCKET	* Buildable by the player (menu 6:1)

AI_CHEAT.UFO

Unit abbv.	Unit #
FLUXOR	430
QUARK 	431
ACKFUS	432
ARMAIVP	440

AI_AIR.UFO

Unit abbv.	Unit #
AAIBRAWL	450
AAIFIG	451
AAIHAWK	452
AAILANCE	453
AAIPNIX	454
AAITHUND	455
CAIAPE	460
CAIHURC	461
CAISHAD	462
CAITITAN	463
CAIVAMP	464
CAIVENG	465

AI_JAM.UFO

Unit abbv.	Unit #	(ALL ai jammers use NULL_WEAPON, weapon id# 191.)
AAIASER	470
AAIJAM	471
CAIETER	472
CAISPEC	473

AI_TACConly.UFO		****WARNING! ONLY USE IF YOU HAVE TA:CC INSTALLED OR TA WILL CRASH! ****

Unit abbv.	Unit #
CCKFUS	433
CAIGANT	441
AAISEAP	456
AAISFIG	457
CAISEAP	466
CAISFIG	467

Comments? Requests? Problems?
contact me at: Switeck@hotmail.com